<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>request</title>
    <script src="http://localhost:8080/webjars/jquery/3.6.0/jquery.js"></script>
</head>
<body>
<h3>同时获取SpringMVC封装的rest参数、查询参数、请求头（包括cookie）、请求体、请求方法、请求属性、ModelMap，原生request、response、session（尚硅谷教程里没有）</h3>
<h3>地址: http://localhost:8080/a4/request.html</h3>
<form id="form" action="http://localhost:8080/a4/all/硕/吃,喝">
    name：<input name="name" value="张三"><br>
    hobby：<input name="hobby" type="checkbox" value="吃" checked>吃 <input name="hobby" type="checkbox" value="喝" checked>喝<br>
    hobby2：<input name="hobby2" type="checkbox" value="嫖" checked>嫖 <input name="hobby2" type="checkbox" value="赌" checked>赌<br>
    hobby3：<input name="hobby3" type="checkbox" value="玩" checked>玩 <input name="hobby3" type="checkbox" value="乐" checked>乐<br>
    photo1：<input name="photo" type="file"><br>
    <input type="submit" value="get提交">
</form>
<button id="post">post提交</button>
<button id="post_file">post文件提交</button>
<script>
    $(function () {
        $("#post").click(function () {
            $("#form").attr("method", "post");
            $("#form").submit();
        })
        $("#post_file").click(function () {
            $("#form").attr("method", "post").attr("enctype", "multipart/form-data");
            $("#form").submit();
        })
    })
</script>
</body>
</html>